#pragma once
#include <boost/array.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/optional.hpp>
#include "UnitFwd.hpp"
#include "RigidBodyFwd.hpp"
#include "TerrainTileVector.hpp"
#include "AnimationController.hpp"
#include "ImportExport.hpp"

class btCollisionShape;

namespace he
{
	class TerrainTile;
	class SceneNodeMotionState;

	//! Unit entity.
	class UnitRenderer : boost::noncopyable
	{
		// Typedefs
	private:

		// Attributes
	private:
		//! Unit.
		UnitPtr_t m_pUnit;
		//! Entity for given unit.
		Ogre::Entity *m_pEntity;
		//! Scene node to which entity is attached.
		Ogre::SceneNode *m_pSceneNode;
		//! Animation.
		std::unique_ptr<AnimationController> m_pAnimation;

		// Operations
	public:
		//! Get entity.
		HE_ENGINE_API Ogre::Entity const &get_entity() const;
		//! Get the bounding box extensions.
		Ogre::Vector3 const get_bounding_box() const;
		//! Update position of scene node.
		HE_ENGINE_API void update_position();
		//! Start animation.
		HE_ENGINE_API void start_animation(std::string const &Name, bool ControlMove, bool ControlRotation);
		//! Stop animation.
		HE_ENGINE_API void stop_animation();
		//! Update.
		HE_ENGINE_API void update(float TimeDelta);
		//! Get actual position (scene node).
		HE_ENGINE_API Ogre::Vector3 position() const;
		//! Animation is running.
		HE_ENGINE_API bool is_animated() const;

	public:
		HE_ENGINE_API UnitRenderer(UnitPtr_t const &pUnit, Ogre::Entity *pEntity, Ogre::SceneNode *pSceneNode, Ogre::Vector3 const &Scale = Ogre::Vector3(1));
	};
} /*he*/
